package study.day5.t11;

public class T11 {
    public static void main(String[] args) {
        Fish[] fishes={new GoldFish("金鱼"),new Shark("鲨鱼")};
        for(Fish fish:fishes){
            fish.eat();
            fish.swim();
            if(fish instanceof Shark shark){
                shark.power();
            }
            fish.show();
            System.out.println("=================");
        }
    }
}
